package org.finmanager.core;


import static org.junit.Assert.*;

import java.util.GregorianCalendar;

import org.finmanager.core.Category;
import org.finmanager.core.Item;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class Item_testing {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
		test2 = new Category("test2");
		test1 = new Item("test1", 2013, 01, 01, 20, test2);
		test3 = new Item();
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void getName_test() {
		assertEquals("message", "test1", test1.getName());
	}
	@Test
	public void getDate_test() {
		assertEquals("message", new GregorianCalendar(2013, 01, 01), test1.getDate());
	}
	@Test
	public void getYear_test() {
		assertEquals("message", 2013, test1.getYear());
	}
	@Test
	public void getMonth_test() {
		assertEquals("message", 01, test1.getMonth());
	}
	@Test
	public void getDayOfMonth_test() {
		assertEquals("message", 01, test1.getDayOfMonth());
	}
	@Test
	public void getAmount_test() {
		assertEquals("message", 20, test1.getAmount(), 0);
	}
	@Test
	public void getCategory_test() {
		assertEquals("message", test2, test1.getCategory());
	}
	
	Item test1, expected, test3;
	Category test2;
	
}
